package org.jeecg.eqp.service.impl;

import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.eqp.entity.EqpSpchkdetailValue;
import org.jeecg.eqp.mapper.EqpSpchkdetailValueMapper;
import org.jeecg.eqp.service.IEqpSpchkdetailValueService;
import org.jeecg.common.api.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Description: 点检记录详细表
 * @Author: shaolong
 * @Date: 2022-10-13
 * @Version: V1.0
 */
@Service
public class EqpSpchkdetailValueServiceImpl extends ServiceImpl<EqpSpchkdetailValueMapper, EqpSpchkdetailValue> implements IEqpSpchkdetailValueService {

    @Autowired
    private EqpSpchkdetailValueMapper eqpSpchkdetailValueMapper;

    @Override
    public List<EqpSpchkdetailValue> selectByMainId(String mainId) {
        return eqpSpchkdetailValueMapper.selectByMainId(mainId);
    }

    @Override
    public Result<String> edit(EqpSpchkdetailValue eqpSpchkdetailValue) {
        LambdaUpdateWrapper<EqpSpchkdetailValue> eq = new LambdaUpdateWrapper<EqpSpchkdetailValue>();
        //eq.eq(EqpSpchkdetailValue::getRecId, qisMatdetailCfg.getRecId());
        boolean update = update(eqpSpchkdetailValue, eq);
        return update ? Result.ok("修改成功!") : Result.error("修改失败!");
    }
}
